// TOWN DIALOGUE SCRIPT
//    Town 95: Southpoint Lighthouse

begintalkscript;

variables;

short i,j,k,r1,choice;

// Garnak

begintalknode;
	tag = 40;
	state = -1;
	nextstate = 1;
	question = "Garnak";
	text1 = "You meet the lighthouse keeper, a wiry, aging man with a misshapen face and a host of tiny scars on his hands and arms.";
	text2 = "He emits a loud, long belch, pats his belly, and chuckles. _'Scuse me. I'm Garnak._";
	text5 = "Garnak frowns and grumbles. _What else do you want?_";
	action = INTRO;

begintalknode;
	state = 1;
	nextstate = 2;
	question = "_Is this lighthouse your responsibility?_";
	text1 = "_Yup, I take care of Southpoint Lighthouse. Beats' workin!_";

begintalknode;
	state = 2;
	nextstate = -1;
	question = "_What do you need to do to maintain the lighthouse?_";
	text1 = "_There's a big fire upstairs. I throw a few sticks into it every day to maintain it. Ships don't founder on the rocks. I get fed. It's a living._";
	text2 = "_But things are still running. If you stop by Shayder, you can let them know we're staying afloat._";
	code =
		if (gf(95,12) == 0) 
			sf(95,12,1);
			else rs(2);
	break;
	
begintalknode;
	state = 2;
	nextstate = 3;
	question = "_Do you like working as a keeper?_";
	text1 = "He grunts. _Eh. I wouldn't be out here were it not for a few, well ... indiscretions in my past. Can't do the old business, but the new business has its points._";

begintalknode;
	state = 3;
	nextstate = -1;
	question = "_What kinds of indiscretions?_";
	text1 = "He burps in irritation. _Not a very tactful question, if I may say so._";

begintalknode;
	state = 3;
	nextstate = 1;
	question = "_What points are those?_";
	text1 = "He says enigmatically, _The old skills are still active, if that's what you mean. I know you wouldn't have come out here if you weren't interested in some trading?_";
	text2 = "He then belches enigmatically.";
	code =
		sf(95,9,1);
	break;
	
begintalknode;
	state = 1;
	nextstate = -1;
	condition = gf(95,9) > 0;
	question = "_Let's do some trading._";
	text1 = "You conclude your business.";
	code =
		begin_shop_mode("Garnak's Supplies","Based on what he offers you for sale, you would guess that Garnak has not always been on the same side as the law.",57,4,3);
	break;
	
begintalknode;
	state = 1;
	nextstate = -1;
	condition = gf(95,9) > 0;
	question = "_I would like to sell something._";
	text1 = "You conclude your business.";	
	code = 
		begin_sell_mode();
	break;

begintalknode;
	state = 1;
	nextstate = -1;
	condition = gf(95,9) > 0;
	question = "_I don't need anything._";
	text1 = "Garnak belches a farewell.";
	action = END_TALK;
	
// Elspeth

begintalknode;
	tag = 60;
	state = -1;
	nextstate = 29;
	question = "Elspeth";
	text1 = "The thing you notice most about this woman are her fingers. They're extremely long and nimble, and they move the crystal she is handling with perfect precision. _I'm Elspeth. Welcome to my little shop._ There are crystals on the counter all around her.";
	text5 = "Elspeth continues working on her crystals. Occasionally, she chips or splits one with a sharp implement.";
	action = INTRO;

begintalknode;
	state = 29;
	nextstate = -1;
	question = "_What sort of shop is this?_";
	text1 = "_I work crystals. This is an excellent place for it. Out here, I can concentrate._ She pulls out a large, velvet lined case, and opens it. It's filled with an eye-popping variety of crystals. _Aren't they beautiful?_";
	text2 = "She winks at you. _And they can be purchased, if you are so inclined._";

begintalknode;
	state = 29;
	nextstate = 30;
	question = "_This is an odd place to have a shop._";
	text1 = "_I don't get visitors often. But it's safe and quiet. We very rarely have any trouble._";

begintalknode;
	state = 30;
	nextstate = 32;
	condition = gf(95,11) <= 1;
	question = "_What sort of trouble have you had?_";
	text1 = "_Well, I lost one of my crystals I was carving. A delicate spiral, ready to be given a rare and powerful enchantment. I would gladly give a set of my finest crystals to whoever returned it to me._";
	action = SET_SDF 95 11 1;
	code =
		toggle_quest(44,1);
	break;

begintalknode;
	state = 32;
	nextstate = 33;
	question = "_Who do you think stole it?_";
	text1 = "_Sadly, I think it was Nekaros. He runs Northpoint Lighthouse. He visited us, and I noticed that the crystal was gone only after his departure. It saddens me. He is an odd fellow, but I didn't think he was a thief._";

begintalknode;
	state = 33;
	nextstate = -1;
	question = "_How is he odd?_";
	text1 = "_He is a necromancer. He reanimates the dead and uses them as servants. Working in an out of the way place like a lighthouse is perfect for one with his unusual interests._";
	
begintalknode;
	state = 30;
	nextstate = 31;
	question = "_What visitors do you get?_";
	text1 = "_A month can go by, and the only people I see are the delivery girl and Garnak._";

begintalknode;
	state = 31;
	nextstate = -1;
	question = "_What sorts of deliveries do you get?_";
	text1 = "_The Empire sends us food every month. Lately, the delivery girl has come guarded, because of the roaches. So it goes._";

begintalknode;
	state = 31;
	nextstate = -1;
	question = "_Do you know Garnak well?_";
	text1 = "_My husband. He's crude, crass, unethical, and gross, but I love him anyway._";

begintalknode;
	state = 29;
	nextstate = -1;
	question = "_Can I purchase some of your crystals?_";
	text1 = "You conclude your business.";
	code =
		begin_shop_mode("Elspeth's Crystals","Elspeth seems, somehow, to have learned some of the crystal-working magical skills of the vahnatai. She is in no way their equal, but she can create some remarkable items.",58,5,3);
	break;

begintalknode;
	state = 29;
	nextstate = -1;
	condition = gf(95,11) == 1 && has_spec_item(2) > 0;
	question = "_I found your crystal. A specter stole it, not Nekaros._ (Give it to her.)";
	code =
		run_hardcode(26);
	break;

begintalknode;
	state = 29;
	nextstate = -1;
	condition = 1;
	question = "_I don't need anything._";
	text1 = "_Farewell. Watch out for evil bugs._";
	action = END_TALK;
